import request from '@/utils/request'

let baseMapping = "/exam_service/listening/";

export default {

  // 分页获取听力信息
  getList(current, limit, title) {
    return request({
      url: baseMapping + `query/${current}/${limit}`,
      method: 'post',
      data: title
    })
  },

  // 通过id获取听力信息
  getListen(id) {
    return request({
      url: baseMapping + `queryListening/${id}`,
      method: 'get'
    })
  },

  // 通过id获取听力信息
  getListening(id) {
    return request({
      url: baseMapping + `getListening/${id}`,
      method: 'get'
    })
  },

  // 通过id删除听力信息
  delete(id) {
    return request({
      url: baseMapping + `deleteListening/${id}`,
      method: 'get'
    })
  },

  // 添加听力信息
  add(listen) {
    return request({
      url: baseMapping + `addListening`,
      method: 'post',
      data: listen
    })
  },

  // 修改听力信息
  update(listen) {
    return request({
      url: baseMapping + `updateListening`,
      method: 'post',
      data: listen
    })
  }
}
